package com.ccx.library.module.TaskHandler;

import com.ccx.library.response.R;
import com.ccx.library.task.TestTask;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.File;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;

/**
 * 反射获取方法
 */
@RestController
@RequestMapping("/Reflection")
public class HandlerController extends TaskHandlerService{

    @GetMapping
    public R getClassName(){
        return R.SUCCESS(getTaskHandler());
    }

    @GetMapping("/getMP")
    public R getMethodParamters(String className){
        try {
            return R.SUCCESS(getTaskMethods(className));
        } catch (ClassNotFoundException e) {
            return R.FAIL("className找不到");
        }
    }
}
